import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory('/wxchat/'),
  // history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/qc/:openid',
      name: 'qc',
      component: () => import('../views/qc/index.vue')
    },
    {
      path: '/otd/:openid',
      name: 'otd',
      component: () => import('../views/otd/index.vue')
    },
    {
      path: '/risk/:openid',
      name: 'risk',
      component: () => import('../views/risk/index.vue')
    },
    {
      path: '/store/:openid',
      name: 'store',
      component: () => import('../views/store/index.vue')
    },
    {
      path: '/detail/:openid/:id',
      name: 'detail',
      component: () => import('../views/store/detail.vue')
    },
    {
      path: '/deliver/:openid',
      name: 'deliver',
      component: () => import('../views/reservation/index.vue')
    },
    {
      path: '/history/:openid',
      name: 'history',
      component: () => import('../views/reservation/list.vue')
    },
    {
      path: '/detail/:openid',
      name: 'detail',
      component: () => import('../views/reservation/detail.vue')
    },
    {
      path: '/404',
      name: '404',
      component: () => import('../views/404/index.vue')
    }
  ]
})

export default router
